<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>结构伪类</title>
		<style type="text/css">
			div ul li:first-child{
				font-size: 90px;
			}
			div ul li:nth-child(2n){
				color: blueviolet;
			}
			div ul li:nth-child(odd){
				color: red;
			}
			div#d2 h1:first-child{
				color:red;
			}
			/*id是d2的Div下面的第一个h1元素*/
			div#d2 h1:first-of-type{
				color:gold;
			}
		</style>
	</head>
	<body>
		<div>
			<ul>
				<li>桃子</li>
				<li>柿子</li>
				<li>杏子</li>
				<li>葡萄</li>
				<li>南瓜</li>
				<li>西红柿</li>
			</ul>
		</div>
		<div id="d2">
			<p>我是渣渣灰</p>
			<h1>大扎好</h1>
			<h2>We change lives</h2>
		</div>
	</body>
</html>